package com.kurumi.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.kurumi.pojo.MedicalRecordPageTrace;
import com.kurumi.query.MedicalRecordQuery;

public interface MedicalRecordTraceMapper {

	/**
	 * 新增病案纸质示踪
	 * @param medicalRecordTrace
	 * @return
	 */
	int insertMedicalRecordPageTrace(MedicalRecordPageTrace medicalRecordPageTrace);

	/**
	 * 获取病案纸质示踪详情
	 * @return
	 */
	List<Map<String,Object>> getMeditalRecordPageTraceByVisitGuid(@Param("visitGuid") String visitGuid);

	/**
	 * 获取纸质归档病案
	 * @return
	 */
	List<Map<String,Object>> getMedicalRecordOfPagePutAwayTrace(MedicalRecordQuery medicalRecordQuery);

	/**
	 * 获取病案示踪数量
	 * @param visitGuid
	 * @param traceTypeCode
	 * @return
	 */
	int getMeditalRecordPageTraceCount(@Param("visitGuid") String visitGuid,@Param("traceTypeCode") String traceTypeCode);

	/**
	 * 获取纸质归档病案数量
	 * @return
	 */
	int getMedicalRecordCountOfPagePutAwayTrace(MedicalRecordQuery medicalRecordQuery);

	/**
	 * 获取病案最新状态
	 * @return
	 */
	List<Map<String,Object>> getMedicalRecordOfPageTrace(MedicalRecordQuery medicalRecordQuery);

	/**
	 * 获取病案最新状态数量
	 * @return
	 */
	int getMedicalRecordCountOfPageTrace(MedicalRecordQuery medicalRecordQuery);


	int deleteMedicalRecordPageTrace(@Param("visitGuid")String visitGuid);

	int deleteMedicalRecordTrace(@Param("visitGuid")String visitGuid);

	/**
	 * 获取已签收病案
	 * @return
	 */
	List<Map<String,Object>> getMedicalRecordOfSigned(MedicalRecordQuery medicalRecordQuery);

	/**
	 * 获取已签收病案数量
	 * @return
	 */
	int getMedicalRecordCountOfSigned(MedicalRecordQuery medicalRecordQuery);

	/**
	 * 获取扫描纸质病案
	 * @return
	 */
	List<Map<String,Object>> getMedicalRecordOfScan(MedicalRecordQuery medicalRecordQuery);

	/**
	 * 获取扫描纸质病案数量
	 * @return
	 */
	int getMedicalRecordCountOfScan(MedicalRecordQuery medicalRecordQuery);


	/**
	 * 依据病案VisitGuid和pageTracetype获取示踪数量
	 * @return
	 */
	int getCountByVisitGuidAndPageTraceTypeCode(@Param("visitGuid")String visitGuid,@Param("pageTraceTypeCode")String pageTraceTypeCode);

	/**
	 * 获取病案最新状态
	 * @return
	 */
	List<String> getLastPageTraceByVisitGuid(String visitGuid);

}
